package com.ruoyi.service.tourism.impl;

import com.ruoyi.mapper.tourism.BusinessCzMapper;
import com.ruoyi.service.tourism.BusinessCzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * @author zeo
 * @explain 滁州商管模块
 * @date 2021/2/2 9:45
 */
@Service
public class BusinessCzServiceImpl implements BusinessCzService {

    @Autowired
    BusinessCzMapper businessCzMapper;

    @Override
    public List<Map<String, Object>> findBusinessCzMonthList(Map map) {
        return businessCzMapper.findBusinessCzMonthList(map);
    }

    @Override
    public List<Map<String, Object>> findBusinessCzDayList(Map map) {
        return businessCzMapper.findBusinessCzDayList(map);
    }

    @Override
    public int addBusinessCz(Map map) {
        String uuid = UUID.randomUUID().toString().trim().replaceAll("-", "");
        map.put("foreignId", uuid);
        businessCzMapper.addShare(map);
        return businessCzMapper.addBusinessCz(map);
    }

    @Override
    public Map findBusinessCzById(String id) {
        return businessCzMapper.findBusinessCzById(id);
    }

    @Override
    public int editBusinessCz(Map map) {
        return businessCzMapper.editBusinessCz(map) + businessCzMapper.editShare(map);
    }

    @Override
    public Map getLastDayData(Map map) {
        return businessCzMapper.getLastDayData(map);
    }
}
